package com.example.controller;


import com.example.service.ReadNcService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/Read")
public class ReadNcController {

    @Resource
    private ReadNcService readNcService;


    @GetMapping("/readNcFile")
    @ResponseBody
    public String readNcFile(@PathVariable(name ="filePath",required = false)String filePath){
        try {
            readNcService.readNcFile(filePath);
        }catch (Exception e){
            e.printStackTrace();
            return "FFF";
        }
        return "SUCCESS";
    }
}
